/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package grex.Conformal;

import grex.Data.Prediction;
import grex.Data.PredictionContainer;
import grex.Environment;
import java.util.ArrayList;

/**
 *
 * @author RIK
 */
    public class ConformalAE implements IConformalMetric {

        @Override
        public double calcAlpha(Prediction p, double realValue) {
            return Math.abs(p.getPrediction() - realValue);
        }

        @Override
        public ArrayList<Double> calcPredictionSet(Prediction prediction, double pAlpha) {
            ArrayList<Double> intervall = new ArrayList<>(2);
            intervall.add(prediction.getPrediction() - pAlpha);
            intervall.add(prediction.getPrediction() + pAlpha);
            return intervall;
        }
        

        @Override
        public void initICPModel(Environment env, PredictionContainer pcTrain) {

        }
    }